<!doctype html>
<html lang="zh-CH">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
	<title>木投网--个人中心--商家入驻</title>
	<link rel="stylesheet" href="/resource/css/mt_index.css">
	<link rel="stylesheet" href="/resource/css/mt_user.css">
	<link rel="stylesheet" href="/resource/css/mt_showBo.css">
</head>
<body>
@include("common.shop_user_head")
		<div class="user-cont left">
			<div class="user-title">
				@if($status == 1||$status == 2||$status == 0)
					<a href="javascript:;" class="active">企业认证</a>
					<a href="javascript:;">企业邀请</a>
					<script src="/resource/js/jquery-1.11.3.min.js"></script>
					<script>
						$('.seller-wrap').hide().eq(0).show();
					</script>
					@elseif($status==11)
					<a href="javascript:;">企业认证</a>
					<a href="javascript:;" class="active">企业邀请</a>
					<script src="/resource/js/jquery-1.11.3.min.js"></script>
					<script>
						$('.seller-wrap').hide().eq(1).show();
					</script>
					@else
					<a href="javascript:;" class="active">企业认证</a>
					<a href="javascript:;">企业邀请</a>
					<script src="/resource/js/jquery-1.11.3.min.js"></script>
					<script>
						$('.seller-wrap').hide().eq(0).show();
					</script>
					@endif
			</div>
			<div class="seller-wrap">
				<div class="seller-til">
					<span>①提交申请</span><i></i><span>②资质审核</span><i></i><span>③创建成功</span>
				</div>
				@if($status==3)
				<div class="seller-before">
					<div class="seller-box">
						<i></i>
						<div class="info">您还不是入驻商家</div>
						<a href="javascript:;">去入驻</a>
					</div>
				</div>
				<!-- 入驻前 -->
				<div class="seller-join">
					<!-- 商家入驻 -->
					<div class="popup-order">
						<div class="order-info">
							温馨提示：请确认上传证件真实、有效、清晰，否则审核将不予通过
						</div>
                        @if(empty($info))
						{{ Form::open(['url'=>'user_seller_join_info', 'files' => true, 'method' => 'post']) }}
						<div class="form-group">
								<label for="">公司名称：</label>
								<input type="text" class="form-control" placeholder="" name="supplier_name" id="supplier_name">
								<i class="i-red">*</i>
								<span id="t_supplier_name">不能为空</span>
							</div>
							<div class="form-group">
								<label for="">公司地址：</label>
								<input type="text" class="form-control" placeholder="" name="address" id="address">
								<i class="i-red">*</i>
								<span id="t_address">不能为空</span>
							</div>
							<div class="form-group">
								<label for="">负责人姓名：</label>
								<input type="text" class="form-control" placeholder="" name="duty_name" id="duty_name">
								<i class="i-red">*</i>
								<span id="t_duty_name">不能为空</span>
							</div>
							<div class="form-group">
								<label for="">负责人手机：</label>
								<input type="text" class="form-control" placeholder="" name="duty_mobile" id="duty_mobile">
								<i class="i-red">*</i>
								<span id="t_duty_mobile">不能为空</span>
							</div>
							<div class="form-group">
								<label for="">营业执照：</label>
								<div class="form-file" id="">
									<i></i>
									上传图片
									<input type="file" name="operate_license" accept="image/*" id="operate_license">
								</div>
								<i class="i-red">*</i>
								<div class="img-name left"></div>
							</div>
							<div class="form-group">
								<label for="">组织机构代码证：</label>
								<div class="form-file" id="">
									<i></i>
									上传图片
									<input type="file" name="organization" accept="image/*" id="organization">
								</div>
								<i class="i-red">*</i>
								<div class="img-name left"></div>
							</div>
							<div class="form-group">
								<label for="">税务登记证：</label>
								<div class="form-file" id="">
									<i></i>
									上传图片
									<input type="file" name="tax_license" accept="image/*" id="tax_license">
								</div>
								<i class="i-red">*</i>
								<div class="img-name left"></div>
							</div>
							<div class="form-group">
								<label for="">开户许可证：</label>
								<div class="form-file" id="">
									<i></i>
									上传图片
									<input type="file" name="account_licence" accept="image/*" id="account_licence">
								</div>
								<i class="i-red">*</i>
								<div class="img-name left"></div>
							</div>
							<input type="submit" class="btn-immed" value="提交申请">
						{{ Form::close() }}
                        @else
                            {{ Form::open(['url'=>'user_seller_join_info', 'files' => true, 'method' => 'post']) }}
                            <div class="form-group">
                                <input type="hidden" name="supplier_id" value="{{$info->supplier_id}}"/>
                                {{--<input type="hidden" name="old_operate_license" value="{{$info->operate_license}}"/>
                                <input type="hidden" name="old_organization" value="{{$info->organization}}"/>
                                <input type="hidden" name="old_account_licence" value="{{$info->account_licence}}"/>
                                <input type="hidden" name="old_tax_license" value="{{$info->tax_license}}"/>--}}
                                <label for="">公司名称：</label>
                                <input type="text" class="form-control" placeholder="" name="supplier_name" id="supplier_name" value="{{$info->supplier_name}}">
                                <i class="i-red">*</i>
                                <span id="t_supplier_name">不能为空</span>
                            </div>
                            <div class="form-group">
                                <label for="">公司地址：</label>
                                <input type="text" class="form-control" placeholder="" name="address" id="address" value="{{$info->address}}">
                                <i class="i-red">*</i>
                                <span id="t_address">不能为空</span>
                            </div>
                            <div class="form-group">
                                <label for="">负责人姓名：</label>
                                <input type="text" class="form-control" placeholder="" name="duty_name" id="duty_name"  value="{{$info->duty_name}}">
                                <i class="i-red">*</i>
                                <span id="t_duty_name">不能为空</span>
                            </div>
                            <div class="form-group">
                                <label for="">负责人手机：</label>
                                <input type="text" class="form-control" placeholder="" name="duty_mobile" id="duty_mobile"  value="{{$info->duty_mobile}}">
                                <i class="i-red">*</i>
                                <span id="t_duty_mobile">不能为空</span>
                            </div>
                            <div class="form-group">
                                <label for="">营业执照：</label>
                                <div class="form-file" id="">
                                    <i></i>
                                    上传图片
                                    <input type="file" name="operate_license" accept="image/*" id="operate_license">
                                </div>
                                <i class="i-red">*</i>
                                <div class="img-name left"></div>
                            </div>
                            <div class="form-group">
                                <label for="">组织机构代码证：</label>
                                <div class="form-file" id="">
                                    <i></i>
                                    上传图片
                                    <input type="file" name="organization" accept="image/*" id="organization">
                                </div>
                                <i class="i-red">*</i>
                                <div class="img-name left"></div>
                            </div>
                            <div class="form-group">
                                <label for="">税务登记证：</label>
                                <div class="form-file" id="">
                                    <i></i>
                                    上传图片
                                    <input type="file" name="tax_license" accept="image/*" id="tax_license">
                                </div>
                                <i class="i-red">*</i>
                                <div class="img-name left"></div>
                            </div>
                            <div class="form-group">
                                <label for="">开户许可证：</label>
                                <div class="form-file" id="">
                                    <i></i>
                                    上传图片
                                    <input type="file" name="account_licence" accept="image/*" id="account_licence">
                                </div>
                                <i class="i-red">*</i>
                                <div class="img-name left"></div>
                            </div>
                            <input type="submit" class="btn-immed" value="提交申请">
                            {{ Form::close() }}
                        @endif
					</div>
					<!-- 企业用户须知 -->
					<div class="join-info">
						<div class="til">企业用户须知</div>
						<ul>
							<li>1. 您在入驻木投网时需要提供您所在企业的营业执照、组织机构代码证、税务登记证、开户许可证，木投网只支3MB以下的jpg、gif、png、jpeg格式的图片或文件。</li>
							<li>2. 您提交申请后会有木投网的资质审核人员在1--2个工作日内完成审核，审核通过后即可成为木投网的企业用户，企业用户可享受<span>采购报价，发布现货商品，免费撮合等多种服务。</span></li>
						</ul>
					</div>
				</div>
					<script src="/resource/js/jquery-1.11.3.min.js"></script>
					<script>
						$('.seller-wrap').hide().eq(0).show();
						$('.user-title a').click(function(){
							var index = $(this).index();
							$(this).addClass('active').siblings().removeClass('active');
							$('.seller-wrap').hide().eq(index).show();
						});
					</script>
				@endif
						@if($status==2)
				<!-- 入驻审核中 -->
				<div class="seller-in">
					<div class="seller-info">
						<div><i></i><span class="left">温馨提示</span></div>
						<div class="last">审核时间为1-2个工作日，通过后，工作人员会电话通知您！</div>
					</div>
					<div class="seller-progress">
						<i></i>
						<div>审核中...</div>
					</div>
				</div>
					<script src="/resource/js/jquery-1.11.3.min.js"></script>
					<script>
						$('.seller-wrap').hide().eq(0).show();
					</script>
				@endif
						@if($status == 1)
				<!-- 入驻审核通过 -->
				 <div class="seller-after">
					<div class="seller-progress">
						<i></i>
						<div>您已通过审核！</div>
					</div>
					<a href="javascript:;">发布现货资源</a>
				</div>
					<script src="/resource/js/jquery-1.11.3.min.js"></script>
					<script>
						$('.seller-wrap').hide().eq(0).show();
					</script>
				@endif
                @if($status == 0)
                        <!-- 入驻审核未通过 -->
                     <div class="seller-no">
                        <div class="seller-progress">
                            <i></i>
                            <div>抱歉，审核未通过！</div>
                        </div>
                        <a href="update_user_seller_join">重新申请</a>
                    </div>
                @endif
			</div>
			<div class="seller-wrap">
				@if($status == 3)
				<div class="seller-invi">
					<div class="left">
						<form action="" class="form">
							<div class="form-group">
								<label for="">邀请码：</label>
								<input type="text" class="form-control" placeholder="请输入邀请码" id="invite_code">
							</div>
							<button type="button" class="btn-login">提交</button>
						</form>
					</div>
					<div class="left invi-info">
						<ul class="ul">
							<li>
								<div class="til">怎么获得邀请码？</div>
								<div class="p">邀请码向管理员索取，24小时内有效</div>
							</li>
						</ul>
						<div class="info">
							<div class="tel">
								<i></i>客服电话<br/><span>400-036-7917</span>
							</div>
						</div>
					</div>
				</div>
					<script src="/resource/js/jquery-1.11.3.min.js"></script>
					<script>
						$('.seller-wrap').hide().eq(0).show();
						$('.user-title a').click(function(){
							var index = $(this).index();
							$(this).addClass('active').siblings().removeClass('active');
							$('.seller-wrap').hide().eq(index).show();
						});
					</script>
				@endif
				<!-- 入驻审核通过 -->
				@if($status == 11)
				<div class="seller-after">
					<div class="seller-progress">
						<i></i>
						<div>您已通过审核！</div>
					</div>
					<a href="/user_now_resource">发布现货资源</a>
				</div>
						<script src="/resource/js/jquery-1.11.3.min.js"></script>
						<script>
							$('.seller-wrap').hide().eq(1).show();
						</script>
				@endif
			</div>
		</div>
@include("common.shop_user_foot")
<script src="/resource/js/jquery-1.11.3.min.js"></script>
<script src="/resource/js/mt_index.js"></script>
<script src="/resource/js/mt_showBo.js"></script>  <!-- 提示信息 -->

<script>
	$('input.form-control').blur(function(){
		if ($(this).val() == '') {
			$(this).siblings('span').show().html('不能为空');
			$('.btn-immed').addClass('btn-black');
		}else{
			$(this).siblings('span').hide();
			$('.btn-immed').removeClass('btn-black');
		};
	});
	$(document).delegate('.btn-immed','click',function(){
		console.log($('#organization').val());
		for (var i = 0; i < $('.popup-order input.form-control').length; i++) {
			if($('.popup-order input.form-control').eq(i).val() == ''){
				$('.popup-order input.form-control').eq(i).focus().siblings('span').show().html('不能为空');
				$('.btn-immed').addClass('btn-black');
				return false;
			};
		};
		if($('#organization').val() == ''){
            alert("图片不能为空");
			return false;
		};
		if($('#operate_license').val() == ''){
            alert("图片不能为空");
			return false;
		};
		if($('#account_licence').val() == ''){
            alert("图片不能为空");
			return false;
		};
		if($('#tax_license').val() == ''){
            alert("图片不能为空");
			return false;
		};
		Showbo.Msg.alert('<img src="/resource/img/popup_success.png" alt=""><div style="width:350px;"></div><br/><div class="popup-pos">审核时间为1-2个工作日，通过后，工作人员会电话通知您</div>');
		$('#dvMsgBtns input.btn').css('width','120px');
	});
	$('.btn-login').click(function(){
		var invite_code = $("#invite_code").val();
		$.ajax({
			url: "/user_seller_join_establishment",
			type: "POST",
			data: "invite_code="+invite_code,
			success: function (msg) {
				if(msg==1){
					location=location;
				}else if(msg==2){
					Showbo.Msg.wait('<img class="left" src="/resource/img/reg_fail.png" alt=""><span class="left">邀请码已使用</span><div class="close" style="color:#00bf8e;left: 186px;bottom: -20px;">确定</div>');
					$('#dvMsgBox .close').show().css({
						'border':'1px solid #00bf8e',
						'left':'186px',
						'bottom': '-20px'
					});
				}else{
                    Showbo.Msg.wait('<img class="left" src="/resource/img/reg_fail.png" alt=""><span class="left">请输入正确的邀请码</span><div class="close" style="color:#00bf8e;left: 186px;bottom: -20px;">确定</div>');
                    $('#dvMsgBox .close').show().css({
                        'border':'1px solid #00bf8e',
                        'left':'186px',
                        'bottom': '-20px'
                    });
                }
			}
		})
	});
</script>
</body>
</html>